#include <stdio.h>
int main(){
  int n;
  scanf("%d",&n);
  
  int arr[n];

  for(int i = 0;i < n;i++){
    scanf("%d",&arr[i]);
  }

  for(int i = 0;i < n-1;i++){
    for(int j = 0;j < n-i-1;j++){
      if(arr[j] > arr[j+1]){
        int t = arr[j];
        arr[j] = arr[j+1];
        arr[j+1] = t;
      }
    }
    for(int j = 0;j < n;j++){
      printf("%d ",arr[j]);
    }
    printf("\n");
  }
}
